package com.example.demo02.constants;

public enum OptType {

    ADDITIONAL_RECORDING(1, "岗亭补录"),
    HAND_LIFTING_ROD(2, "手动抬杆"),
    VISITOR_REGISTER(3, "访客登记"),
    MODIFY_PLATE_NO(4, "修改车牌"),
    FOREIGN_BODY_LIFTING_ROD(5, "异物抬杆"),
    HAND_DROP_ROD(6, "手动落杆"),
    HAND_CAPTURE(7,"手动抓拍"),
    OPEN_VIDEO(8, "开启视频"),
    CLOSE_VIDEO(9, "关闭视频"),
    CALCULATED_PREFERENCE(10, "计算优惠"),
    HAND_MATCHING_ENTRY(11, "手动匹配入场"),
    LOCK_LIFTING(12,"锁定抬杆"),
    UNLOCK_LIFTING(13,"解除锁定")
    ;
    public int code;
    public String label;

    private OptType(int code, String label) {
        this.code = code;
        this.label = label;
    }

    /**
     * 获取状态码描述
     *
     * @param code
     *          状态码
     * @return 状态码描述，如果没有返回空串
     */
    public static String getLabel(int code) {
        String result = "";
        for (OptType status : OptType.values()) {
            if (status.code == code) {
                result = status.label;
            }
        }
        return result;
    }
}
